package ch06;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test {
    private static ApplicationContext applicationContext ;
    static{
        applicationContext = new ClassPathXmlApplicationContext("ch06/spring.xml") ;
    }

    public static void test1(){
        Person person = (Person) applicationContext.getBean("person") ;
        person.show();
    }

    public static void test2(){
        Person person = (Person) applicationContext.getBean("person1") ;
        person.show();
    }

    public static void test3(){
       BigClass bigClass = (BigClass) applicationContext.getBean("bigClass") ;
       bigClass.show();
    }

    public static  void test4(){
        PersonDao personDao = (PersonDao) applicationContext.getBean("personDao") ;
        personDao.del(1);
    }



    public static void main(String[] args) {
        test4() ;
    }
}
